package com.supcon.exchangedata.repository.master;
import com.supcon.exchangedata.pojo.entity.oracle.CtGpsStatisitcInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @program: exchange-data
 * @description: gps数据
 * @author: cherubr.Sumin
 * @create: 2021-12-15 14:19
 **/
public interface SlaveCarGpsInfo extends JpaRepository<CtGpsStatisitcInfo,String> {

    CtGpsStatisitcInfo findCtGpsStatisitcInfoByLicensePlateNum(String license);

    public int deleteAllByTypeAndLayerCode(Long type,String layerCode);

    @Transactional
    @Modifying(clearAutomatically = true)
    @Query("delete CtGpsStatisitcInfo ct where ct.type =?1 and ct.layerCode =?2")
    public Integer deleteByTypeAndLayerCodeDiy(Long type,String layerCode);

    public List<CtGpsStatisitcInfo> findByTypeAndAndLayerCode(Long type,String layerCode);
}
